import java.util.ArrayList;
import java.util.List;

/**
 * @author：刘东
 * @created: 2013-8-19 下午5:35:49 
 * @version：$Id$ 
 * @since:1.0
 * @copyright
 *
 */
/**
 * 
 */

/**
 * @author： 刘东
 * @created: 2013-8-19 下午5:35:49
 * @version：
 * @since:1.0
 * @copyright 说明：数到3的同学站出来
 */

public class lzwCode {

	/**
	 * @param args
	 */
	public void viewCode(String code, int path) {
		List<Integer> list = new ArrayList<Integer>();
		String codes[] = code.split(",");
		for (int i = 0; i < codes.length; i++) {
			list.add(Integer.parseInt(codes[i]));
		}
		int m = 0;
		while (list.size() > 0) {
			for (int j = 0; j < list.size(); j++) {
				m++;
				if (m % path == 0) {
					System.out.println("当前的孩子是 " + list.remove(j));
					j--;
					m = 0;
				}
			}
		}
	}

	public static void main(String[] args) {
		lzwCode lc = new lzwCode();
		lc.viewCode("13,12,3,6,43,44,55,33,44,66,77", 3);

	}

}
